package com.atguigu.create.factory.simplefactory.order;

import com.atguigu.create.factory.simplefactory.pizza.CheesePizza;
import com.atguigu.create.factory.simplefactory.pizza.GreekPizza;
import com.atguigu.create.factory.simplefactory.pizza.Pizza;

public class PizzaSimpleFactory {
    // 原始模式
    public Pizza createPizza(String orderType){
        switch (orderType){
            case "greek":return new GreekPizza();
            case "cheese":return new CheesePizza();
            default:return null;
        }
    }

    // 静态模式
    public static Pizza createPizza2(String orderType){
        switch (orderType){
            case "greek":return new GreekPizza();
            case "cheese":return new CheesePizza();
            default:return null;
        }
    }
}
